home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-17 | 8.0 KB | 211 lines | [TEXT/MPS ] |
- #
- # ****************************************************************************
- #
- # File Name: MacWrite.vu
- #
- # Contains: Quick look test script for MacWrite II version 1.1v3
- #
- # Written by: Kevin Avoy, Ken Landreth, Michael Leong, Gil Spencer et al
- #
- # Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
- #
- # ****************************************************************************
- # C h a n g e H i s t o r y (most recent first):
- # ****************************************************************************
- #
- # Vers Date Author Description
- # ---- -------- ------ ---------------------------------------------
- # <1.0.6> 9/30/93 KTA Initialize gFileName prior to gApptitle being updated by
- # launchTwitch().
- # <1.0.5> 9/23/93 KTA WordProcessor.Lib was not defined as a dependancy.
- # <1.0.2> 6/16/93 NAGA Renaming InitGlobals(ScriptLevel)to InitGlobals(ScriptLevel)
- # <1+> 5/25/93 NAGA Adding header and porting old files to follow new standards
- #
- # ****************************************************************************
- #
-
-
-
- ########################################################################
- # External libraries
- #=======================================================================
- Libraries "Output.Lib", "DoTasks.Lib","Draw.Lib","UserInterface.Lib", "Font.Lib", "Globals.Lib", "LaunchQuit.Lib", "TCS.Lib", "WordProcessor.Lib";
-
-
- #########################################################################
- ######## Application Specific Tasks
- #########################################################################
-
-
- #########################################################################
- # InitAppGlobals()
- #========================================================================
- # Author: ML
- # Description: Sets up the app's globals.
- # Parameters: None
- # Returns: Nothing
- # Application: Word
- # Examples: InitAppGlobals()
- #========================================================================
- # History:
- #
- ########################################################################
- task InitAppGlobals()
- begin
-
- logstr("setting up {global gApptitle}'s globals");
-
- global kClick, kDrag, kDragClick, kMultiDrag, kMultiClickDrag, kMultiClick;
- global kPalDocWind, kPalWind, kPullOffPal, kPopUpPal, kScrollPal;
- global kTabPaletteNum := 1;
- global kAlignPaletteNum := 2;
- global kSpacingPaletteNum := 3;
- global kIncSpacePaletteNum := 4;
-
- #global gTextStr;
-
- global gPaletteList := {
- { #### Start Palette #1 - Tabs
- {76,52,166,65,0}, # Location of tab palette relative to the window
- kPalDocWind, # Palette type
- {4,1}, # Size of Tool matrix {numElemsWide,numElemsTall}
- {24,12}, # Offset between tools {h,v}
- 0, # Not used at this time
- 0 # Not used at this time
- }, #### End Palette #1
- { #### Start Palette #2 - Alignment
- {434,52,525,65,0}, # Location of alignment palette relative to the window
- kPalDocWind, # Palette type
- {4,1}, # Size of Tool matrix {numElemsWide,numElemsTall}
- {24,12}, # Offset between tools {h,v}
- 0, # Not used at this time
- 0 # Not used at this time
- }, #### End Palette #2
- { #### Start Palette #3 - Line spacing
- {244,52,311,65,0}, # Location of Line spacing palette relative to the window
- kPalDocWind, # Palette type
- {3,1}, # Size of Tool matrix {numElemsWide,numElemsTall}
- {24,12}, # Offset between tools {h,v}
- 0, # Not used at this time
- 0 # Not used at this time
- }, #### End Palette #3
- { #### Start Palette #4 - Incremental Line spacing
- {317,52,335,65,0}, # Location of Line Paragraph spacing palette relative to the window
- kPalDocWind, # Palette type
- {2,1}, # Size of Tool matrix {numElemsWide,numElemsTall}
- {8,12}, # Offset between tools {h,v}
- 0, # Not used at this time
- 0 # Not used at this time
- } # End Palette #4
- };
-
- ### Word {Flag, Pattern, Line, Color}
- ### Palette Elements:= Tool#, Pal#, ToolName, ToolType, DblClktoEnd SetAttributes
- global TabLeftTool := { 1, 1, "Tab Left", kDragClick, 0, {0} };
- global TabCenterTool := { 2, 1, "Tab Center", kDragClick, 0, {0} };
- global TabRightTool := { 3, 1, "Tab Right", kDragClick, 0, {0} };
- global TabAlignOnTool := { 4, 1, "Tab Align On", kDragClick, 0, {0} };
- global AlignLeftTool := { 1, 2, "Align Left", 0, 0, {0} };
- global AlignCenterTool := { 2, 2, "Align Center", 0, 0, {0} };
- global AlignRightTool := { 3, 2, "Align Right", 0, 0, {0} };
- global AlignLRTool := { 4, 2, "Align LR", 0, 0, {0} };
- global SingleSpaceTool := { 1, 3, "Single Space", 0, 0, {0} };
- global xSpaceTool := { 2, 3, "1-1/2 Space", 0, 0, {0} };
- global DoubleSpaceTool := { 3, 3, "Double Space", 0, 0, {0} };
- global IncSpaceTool := { 1, 4, "Increment Space", 0, 0, {0} };
- global DecSpaceTool := { 2, 4, "Decrement Space", 0, 0, {0} };
-
- # global Tool list
-
- global RulerRect:= {76,40,125,42};
-
- global TabToolList:={ TabLeftTool,
- TabCenterTool,
- TabRightTool,
- TabDecimalTool
- };
-
- global OtherToolList:={ AlignLeftTool,
- AlignCenterTool,
- AlignRightTool,
- AlignLRTool,
- SingleSpaceTool,
- xSpaceTool,
- DoubleSpaceTool,
- IncSpaceTool,
- DecSpaceTool
- };
-
- global RulerMenuPath := {'Show Ruler','Format'};
-
- global SelectAllFlag := 1;
-
- ### font characteristic lists
- global gFontSizeList := {'7','9','10','12','14','18', '24','36','48','60','72'};
- global gFontStyleList := {'Bold','Italic','Strike Thru','Outline','Shadow',
- 'Underline','Word Underline','Double Underline'};
-
- ### Name of the Plain (style) menu item ####
- global gPlainStyle := "Plain Text"; # Plain-Style menu item
-
- ### How to get to the next line
- global gNextLineMethod := 1;
- ### 1 - ReturnKey, 2 - EnterKey, 3 - DownArrow Key, 4 - TabKey, {} - Move/Click, {'Untitled'} - Move relative to the window titled 'Untitled' /Click
-
- ### Does moving to the next line clear all font info
- global gNextLineClearsFontSettings := 0;
-
- end; #InitAppGlobals
-
- #########################################################################
- # Views()
- #========================================================================
- # Author: ML
- # Description: Change Views.
- # Parameters: None
- # Returns: Nada
- # Application: Word
- # Examples: Views();
- #========================================================================
- # History:
- #
- ########################################################################
- task Views()
- begin
- LogStr( "Changing Views ");
- selectMenuItem("Reduced Size", "View");
- selectMenuItem("Side by Side", "View");
- selectMenuItem("Actual Size", "View");
- end;
-
- ################################################################################
- #################### Main script ####################
- ################################################################################
- script MacWrite (ScriptLevel:= -1)
- begin
- InitGlobals(ScriptLevel);
- InitDraw();
- InitFonts();
- global gAppTitle := 'MacWrite II';
- global gAppVersion := '1'; # version of app you will be running
- global gFileName := "@!@-{gBuildVers}-{gAppTitle}"; #This is used in SaveAs when saving files
- SuiteStart('MacWrite.vu'); # begin a new test suite
- if LaunchTwitch("{gAppTitle}",gAliasDirectory) # launch or twitch to your app
- begin
- InitAppGlobals();
- (*
- *)
- DoSetUpApp(,,,,1,1);
- DoText();
- if (gAppTestLevel = 2)
- DoWPTools(); # Currently can't select tools with mousedown
- Views();
- DoWindow();
- DoCloseApp(1,1,,,2); # Quit with KeyEq because menu selection fails
- end; # if LaunchTwitch("{gAppTitle}",gAliasDirectory)
- SuiteEnd();
- end; # script MacWrite
-
- ### What's Needed/Problems
- # Note:Custom mdef makes MacWrite select menuItems move up and down - this can be unreliable.
- # Quit with KeyEq because menu selection fails